package Person.exa.FunctionUtils;

import Person.exa.Dao.StudnetManagerDao;
import Person.exa.Student.Student;
import Person.exa.impl.StudentManagerImpl;

import java.util.ArrayList;
import java.util.Scanner;

public class FunctionUtils {
    static Scanner sc = new Scanner(System.in);
    static ArrayList<Student> list = new ArrayList<>();
    public static void choiceFunction(){
        StudnetManagerDao sm = new StudentManagerImpl();
        String choice = sc.nextLine();
        switch(choice){
            case"1":
                //添加学生
                sm.add(list);
                break;
            case"2":
                //删除学生
                sm.delete(list);
                break;
            case"3":
                //修改学生
                sm.update(list);
                break;
            case"4":
                //查看所有学生
                sm.show(list);
                break;
            case"5":
                System.out.println("谢谢使用！");
                System.exit(0);
        }
    }
}
